<?
   $this->headLink()
           ->appendStylesheet($this->baseUrl("css/prettify.css"));

   $this->headScript()
           ->appendFile($this->baseUrl("js/init.prettify.js"))
           ->appendFile($this->baseUrl("js/prettify.js"))
           ->appendFile($this->baseUrl("js/mobile/evento/programacao.js"));
?>

<div data-role="navbar">
   <ul>
      <? foreach($this->diasEncontro as $value):
            $date = new Zend_Date($value['data']);
      ?>
      <li><a href="#" data-id="<?=$date->toString('dd-MMM') ?>"><?=$date->toString('dd MMM') ?></a></li>
      <? endforeach; ?>
   </ul>
</div>

<?
$data_atual = null;
$count = 0;
if (! empty($this->lista)):
   foreach ($this->lista as $item):
      if ($item['data'] != $data_atual) {
         $date = new Zend_Date($item['data']);
         $data_atual = $item['data'];
         if ($count > 0) {
   ?>
   </div><!-- fecha div data-role=collapsible-set -->
   <?
         }
   ?>
   <div id="<?=$date->toString('dd-MMM') ?>" data-role="collapsible-set" class="dia" style="display: none;">
   <?
         $count++;
      } // end if test data !=
?>
      <div data-role="collapsible" data-theme="c" data-content-theme="d">
         <h4>
            <?=$item['nome_tipo_evento'] ?>: <?=$item['nome_evento'] ?>
            <? if (! empty($item['descricao'])) : ?>
            (<?=$item['descricao'] ?>)
            <? endif; ?>
            <span style="color: gray; float: right"><?=$item['hora_inicio'] ?></span>
         </h4>
         <div class="ui-grid-a ui-responsive">
            <div class="ui-block-a" style="padding-top: 20px;">
               <div class="ui-body">Sala <?=$item['nome_sala'] ?></div>
            </div>
            <div class="ui-block-b">
               <div class="ui-body">
                  <?
                  if (!empty($item['twitter'])) {
                     $id = $item['twitter'];
                  } else {
                     $id = $item['id_pessoa'];
                  }
                  ?>
                  por <a href="<?=$this->url(array('id' => $id),
                        'mobile_ver', true) ?>" target="blank" data-ajax="false"
                        data-role="button" data-inline="true"><?=$item['nome'] ?></a>
                   <? if ($item['outros'] == 1): ?>
                      e outro.
                   <? elseif ($item['outros'] > 1): ?>
                      e <?=$item['outros'] ?> outros.
                   <? endif; ?>
               </div>
            </div>
         </div><!-- /grid-a -->
         <p><?=$item['resumo'] ?></p>
         <a href="<?=$this->url(array('id' => $item['id_evento']),
              'mobile_ver_evento', true) ?>#disqus_thread" data-role="button" data-ajax="false">
            <i class="icon-comments-alt"></i> Comentários
         </a>
      </div>
<?
   endforeach;
else:
?>
Não há eventos.
<? endif; ?>
